package com.bw.controller.comment;

import com.alibaba.dubbo.config.annotation.Reference;
import com.bw.entity.Result;
import com.bw.pojo.comment.StoreReply;
import com.bw.service.comment.StoreReplyService;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/storeReply")
public class StoreReplyController {
    @Reference
    private StoreReplyService storeReplyService;

    @GetMapping("/findById")
    public StoreReply findById(String id){
        return storeReplyService.findById(id);
    }

    @PostMapping("/findByProductReplyId")
    public List<StoreReply> findByProductReplyId(@RequestBody Map<String,Object> searchMap){
        return storeReplyService.findByProductReplyId(searchMap);
    }
    @PostMapping("/add")
    public Result add(@RequestBody StoreReply storeReply){
        storeReplyService.add(storeReply);
        return new Result();
    }
    /**
     * 删除管理员评论
     */
    @GetMapping("/delete")
    public Result delete(String id){
        storeReplyService.delete(id);
        return new Result();
    }
    /**
     * 还原管理员评论
     */
    @GetMapping("/restore")
    public Result restore(String id){
        storeReplyService.restore(id);
        return new Result();
    }

}
